Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

ZERO(s(x)) → EQ(x, s(0))
IF(false, x, y) → PR(x, y)
PLUS(s(x), y) → P(s(x))
TIMES(s(x), y) → PLUS(y, times(x, y))
ZERO(s(x)) → PLUS(0, zero(0))
ZERO(s(x)) → PLUS(zero(0), 0)
TIMES(s(x), y) → TIMES(x, y)
PLUS(x, s(y)) → P(s(y))
DIVIDES(y, x) → EQ(x, times(div(x, y), y))
PR(x, s(s(y))) → DIVIDES(s(s(y)), x)
PLUS(s(x), y) → PLUS(x, y)
DIVIDES(y, x) → DIV(x, y)
QUOT(x, 0, s(z)) → DIV(x, s(z))
QUOT(s(x), s(y), z) → QUOT(x, y, z)
PLUS(x, s(y)) → PLUS(x, p(s(y)))
DIV(x, y) → QUOT(x, y, y)
PRIME(s(s(x))) → PR(s(s(x)), s(x))
DIVIDES(y, x) → TIMES(div(x, y), y)
DIV(div(x, y), z) → ZERO(y)
DIV(div(x, y), z) → TIMES(zero(y), z)
ZERO(s(x)) → IF(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))
PR(x, s(s(y))) → IF(divides(s(s(y)), x), x, s(y))
DIV(div(x, y), z) → DIV(x, times(zero(y), z))
EQ(s(x), s(y)) → EQ(x, y)
PLUS(s(x), y) → PLUS(p(s(x)), y)
ZERO(s(x)) → ZERO(0)

The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ZERO(s(x)) → EQ(x, s(0))
IF(false, x, y) → PR(x, y)
PLUS(s(x), y) → P(s(x))
TIMES(s(x), y) → PLUS(y, times(x, y))
ZERO(s(x)) → PLUS(0, zero(0))
ZERO(s(x)) → PLUS(zero(0), 0)
TIMES(s(x), y) → TIMES(x, y)
PLUS(x, s(y)) → P(s(y))
DIVIDES(y, x) → EQ(x, times(div(x, y), y))
PR(x, s(s(y))) → DIVIDES(s(s(y)), x)
PLUS(s(x), y) → PLUS(x, y)
DIVIDES(y, x) → DIV(x, y)
QUOT(x, 0, s(z)) → DIV(x, s(z))
QUOT(s(x), s(y), z) → QUOT(x, y, z)
PLUS(x, s(y)) → PLUS(x, p(s(y)))
DIV(x, y) → QUOT(x, y, y)
PRIME(s(s(x))) → PR(s(s(x)), s(x))
DIVIDES(y, x) → TIMES(div(x, y), y)
DIV(div(x, y), z) → ZERO(y)
DIV(div(x, y), z) → TIMES(zero(y), z)
ZERO(s(x)) → IF(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))
PR(x, s(s(y))) → IF(divides(s(s(y)), x), x, s(y))
DIV(div(x, y), z) → DIV(x, times(zero(y), z))
EQ(s(x), s(y)) → EQ(x, y)
PLUS(s(x), y) → PLUS(p(s(x)), y)
ZERO(s(x)) → ZERO(0)

The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 4 SCCs with 11 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

EQ(s(x), s(y)) → EQ(x, y)

The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

EQ(s(x), s(y)) → EQ(x, y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

PLUS(x, s(y)) → PLUS(x, p(s(y)))
PLUS(s(x), y) → PLUS(p(s(x)), y)
PLUS(s(x), y) → PLUS(x, y)

The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ MNOCProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

PLUS(x, s(y)) → PLUS(x, p(s(y)))
PLUS(s(x), y) → PLUS(p(s(x)), y)
PLUS(s(x), y) → PLUS(x, y)

The TRS R consists of the following rules:

p(s(x)) → x

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the modular non-overlap check [15] to enlarge Q to all left-hand sides of R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
              ↳ QDP
                ↳ MNOCProof
QDP
                    ↳ RuleRemovalProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

PLUS(x, s(y)) → PLUS(x, p(s(y)))
PLUS(s(x), y) → PLUS(p(s(x)), y)
PLUS(s(x), y) → PLUS(x, y)

The TRS R consists of the following rules:

p(s(x)) → x

The set Q consists of the following terms:

p(s(x0))

We have to consider all minimal (P,Q,R)-chains.
By using the rule removal processor [15] with the following polynomial ordering [25], at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

PLUS(s(x), y) → PLUS(x, y)

Strictly oriented rules of the TRS R:

p(s(x)) → x

Used ordering: POLO with Polynomial interpretation [25]:

POL(PLUS(x1, x2)) = x1 + 2·x2   
POL(p(x1)) = x1   
POL(s(x1)) = 1 + 2·x1   



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
              ↳ QDP
                ↳ MNOCProof
                  ↳ QDP
                    ↳ RuleRemovalProof
QDP
                        ↳ DependencyGraphProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

PLUS(x, s(y)) → PLUS(x, p(s(y)))
PLUS(s(x), y) → PLUS(p(s(x)), y)

R is empty.
The set Q consists of the following terms:

p(s(x0))

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 2 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

TIMES(s(x), y) → TIMES(x, y)

The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

TIMES(s(x), y) → TIMES(x, y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

DIV(div(x, y), z) → ZERO(y)
QUOT(x, 0, s(z)) → DIV(x, s(z))
ZERO(s(x)) → IF(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))
QUOT(s(x), s(y), z) → QUOT(x, y, z)
PR(x, s(s(y))) → IF(divides(s(s(y)), x), x, s(y))
DIV(x, y) → QUOT(x, y, y)
DIV(div(x, y), z) → DIV(x, times(zero(y), z))
PR(x, s(s(y))) → DIVIDES(s(s(y)), x)
IF(false, x, y) → PR(x, y)
DIVIDES(y, x) → DIV(x, y)

The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


DIV(div(x, y), z) → ZERO(y)
DIV(div(x, y), z) → DIV(x, times(zero(y), z))
The remaining pairs can at least be oriented weakly.

QUOT(x, 0, s(z)) → DIV(x, s(z))
ZERO(s(x)) → IF(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))
QUOT(s(x), s(y), z) → QUOT(x, y, z)
PR(x, s(s(y))) → IF(divides(s(s(y)), x), x, s(y))
DIV(x, y) → QUOT(x, y, y)
PR(x, s(s(y))) → DIVIDES(s(s(y)), x)
IF(false, x, y) → PR(x, y)
DIVIDES(y, x) → DIV(x, y)
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(DIV(x1, x2)) = x1   
POL(DIVIDES(x1, x2)) = x2   
POL(IF(x1, x2, x3)) = x2   
POL(PR(x1, x2)) = x1   
POL(QUOT(x1, x2, x3)) = x1   
POL(ZERO(x1)) = 0   
POL(div(x1, x2)) = 1 + x1 + x2   
POL(divides(x1, x2)) = x1 + x2   
POL(eq(x1, x2)) = 0   
POL(false) = 0   
POL(if(x1, x2, x3)) = 0   
POL(p(x1)) = x1   
POL(plus(x1, x2)) = x1   
POL(pr(x1, x2)) = 0   
POL(quot(x1, x2, x3)) = x1 + x2   
POL(s(x1)) = x1   
POL(times(x1, x2)) = x1 + x2   
POL(true) = 0   
POL(zero(x1)) = x1   

The following usable rules [17] were oriented:

plus(x, 0) → x



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
QDP
                ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

QUOT(x, 0, s(z)) → DIV(x, s(z))
QUOT(s(x), s(y), z) → QUOT(x, y, z)
ZERO(s(x)) → IF(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))
PR(x, s(s(y))) → IF(divides(s(s(y)), x), x, s(y))
DIV(x, y) → QUOT(x, y, y)
PR(x, s(s(y))) → DIVIDES(s(s(y)), x)
IF(false, x, y) → PR(x, y)
DIVIDES(y, x) → DIV(x, y)

The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 2 SCCs with 3 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ DependencyGraphProof
                  ↳ AND
QDP
                      ↳ QDPOrderProof
                    ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

QUOT(x, 0, s(z)) → DIV(x, s(z))
QUOT(s(x), s(y), z) → QUOT(x, y, z)
DIV(x, y) → QUOT(x, y, y)

The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


QUOT(s(x), s(y), z) → QUOT(x, y, z)
The remaining pairs can at least be oriented weakly.

QUOT(x, 0, s(z)) → DIV(x, s(z))
DIV(x, y) → QUOT(x, y, y)
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(DIV(x1, x2)) = x1   
POL(QUOT(x1, x2, x3)) = x1   
POL(s(x1)) = 1 + x1   

The following usable rules [17] were oriented: none



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ DependencyGraphProof
                  ↳ AND
                    ↳ QDP
                      ↳ QDPOrderProof
QDP
                          ↳ Instantiation
                    ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

QUOT(x, 0, s(z)) → DIV(x, s(z))
DIV(x, y) → QUOT(x, y, y)

The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By instantiating [15] the rule DIV(x, y) → QUOT(x, y, y) we obtained the following new rules:

DIV(y_0, s(y_1)) → QUOT(y_0, s(y_1), s(y_1))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ DependencyGraphProof
                  ↳ AND
                    ↳ QDP
                      ↳ QDPOrderProof
                        ↳ QDP
                          ↳ Instantiation
QDP
                              ↳ DependencyGraphProof
                    ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

QUOT(x, 0, s(z)) → DIV(x, s(z))
DIV(y_0, s(y_1)) → QUOT(y_0, s(y_1), s(y_1))

The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 2 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ DependencyGraphProof
                  ↳ AND
                    ↳ QDP
QDP
                      ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

PR(x, s(s(y))) → IF(divides(s(s(y)), x), x, s(y))
IF(false, x, y) → PR(x, y)

The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
plus(x, 0) → x
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → s(plus(p(s(x)), y))
plus(x, s(y)) → s(plus(x, p(s(y))))
times(0, y) → 0
times(s(0), y) → y
times(s(x), y) → plus(y, times(x, y))
div(0, y) → 0
div(x, y) → quot(x, y, y)
quot(zero(y), s(y), z) → 0
quot(s(x), s(y), z) → quot(x, y, z)
quot(x, 0, s(z)) → s(div(x, s(z)))
div(div(x, y), z) → div(x, times(zero(y), z))
eq(0, 0) → true
eq(s(x), 0) → false
eq(0, s(y)) → false
eq(s(x), s(y)) → eq(x, y)
divides(y, x) → eq(x, times(div(x, y), y))
prime(s(s(x))) → pr(s(s(x)), s(x))
pr(x, s(0)) → true
pr(x, s(s(y))) → if(divides(s(s(y)), x), x, s(y))
if(true, x, y) → false
if(false, x, y) → pr(x, y)
zero(div(x, x)) → x
zero(divides(x, x)) → x
zero(times(x, x)) → x
zero(quot(x, x, x)) → x
zero(s(x)) → if(eq(x, s(0)), plus(zero(0), 0), s(plus(0, zero(0))))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: